手机box一体化,修改时间同步相关

chengzhenyu 8 年 前
コミット
4ffbc4e51f

+ 3 - 11
app/src/main/java/ai/pai/lensman/briefs/BriefsActivity.java

@@ -5,9 +5,7 @@ import android.graphics.Color;
5 5
 import android.os.Bundle;
6 6
 import android.support.annotation.IdRes;
7 7
 import android.support.annotation.Nullable;
8
-import android.text.SpannableString;
9 8
 import android.text.TextUtils;
10
-import android.text.style.UnderlineSpan;
11 9
 import android.view.Gravity;
12 10
 import android.view.View;
13 11
 import android.widget.RadioGroup;
@@ -37,11 +35,10 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{
37 35
     @BindView(R.id.tv_week_point_amount)    TextView weekPointAmountText;
38 36
     @BindView(R.id.switcher_order_msg)      TextSwitcher orderMsgSwitch;
39 37
     @BindView(R.id.switcher_system_msg)     TextSwitcher systemMsgSwitch;
40
-    @BindView(R.id.tv_box_num)              TextView boxNumText;
41
-    @BindView(R.id.tv_box_status)           TextView boxStatusText;
38
+
42 39
     @BindView(R.id.tv_current_price)        TextView currentPriceText;
43 40
     @BindView(R.id.rg_upload_settings)      RadioGroup uploadDelayRadioGroup;
44
-    @BindView(R.id.tv_box_version)          TextView boxVersionText;
41
+
45 42
     private BriefsPresenter presenter;
46 43
 
47 44
     @Override
@@ -81,10 +78,6 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{
81 78
         };
82 79
         orderMsgSwitch.setFactory(factory);
83 80
         systemMsgSwitch.setFactory(factory);
84
-        String version = String.valueOf(Preferences.getInstance().getBoxVersionCode());
85
-        SpannableString content = new SpannableString(version +" "+ getString(R.string.upgrade_now));
86
-        content.setSpan(new UnderlineSpan(), version.length()+1, content.length(), 0);
87
-        boxVersionText.setText(content);
88 81
         presenter = new BriefsPresenter(this,this);
89 82
     }
90 83
 
@@ -159,8 +152,7 @@ public class BriefsActivity extends BaseActivity implements BriefsContract.View{
159 152
 
160 153
     @Override
161 154
     public void updateBoxInfo(String boxNo, String boxStatus) {
162
-        boxNumText.setText(boxNo);
163
-        boxStatusText.setText(boxStatus);
155
+
164 156
     }
165 157
 
166 158
     @Override

+ 3 - 1
app/src/main/java/ai/pai/lensman/main/MainPresenter.java

@@ -130,7 +130,6 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
130 130
     @Override
131 131
     public void stop() {
132 132
         boxStatusInteractor.cancelJob();
133
-//        syncTimeInteractor.cancelJob();
134 133
         App.getAppContext().unbindService(uploadServiceConnection);
135 134
         App.getAppContext().unbindService(orderServiceConnection);
136 135
         App.getAppContext().unregisterReceiver(wifiReceiver);
@@ -236,6 +235,9 @@ class MainPresenter implements MainContract.Presenter,SyncTimeInteractor.SyncTim
236 235
     @Override
237 236
     public void onTimeSync(boolean result, @StringRes int strId) {
238 237
         isTimeSync = result;
238
+        if(!isTimeSync){
239
+            view.showSnackBar(R.string.check_box_time);
240
+        }
239 241
     }
240 242
 
241 243
 }

+ 9 - 45
app/src/main/java/ai/pai/lensman/main/SyncTimeInteractor.java

@@ -1,11 +1,9 @@
1 1
 package ai.pai.lensman.main;
2 2
 
3 3
 import android.os.AsyncTask;
4
-import android.os.SystemClock;
5 4
 import android.support.annotation.StringRes;
6 5
 
7 6
 import com.android.common.executors.ThreadExecutor;
8
-import com.android.common.http.HttpUtils;
9 7
 import com.android.common.utils.LogHelper;
10 8
 
11 9
 import org.json.JSONObject;
@@ -14,10 +12,7 @@ import java.text.SimpleDateFormat;
14 12
 import java.util.Date;
15 13
 import java.util.HashMap;
16 14
 
17
-import ai.pai.lensman.BuildConfig;
18
-import ai.pai.lensman.R;
19 15
 import ai.pai.lensman.base.BaseInteractor;
20
-import ai.pai.lensman.utils.BoxUrlContainer;
21 16
 import ai.pai.lensman.utils.HttpPostTask;
22 17
 import ai.pai.lensman.utils.UrlContainer;
23 18
 
@@ -45,55 +40,24 @@ public class SyncTimeInteractor implements BaseInteractor {
45 40
         LogHelper.d("czy", "开始时间同步任务");
46 41
         timeSyncTask = new HttpPostTask(params) {
47 42
 
48
-            int msgId = R.string.sync_time_box_error;
49
-
50 43
             @Override
51 44
             protected boolean parseResponse(String response) {
45
+                if(isCancelled){
46
+                    return false;
47
+                }
52 48
                 LogHelper.d("czy", "时间同步任务 服务器应答=" + response);
53
-                String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
49
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
54 50
                 try {
55 51
                     JSONObject json = new JSONObject(response);
56 52
                     int status = json.getInt("status");
57 53
                     if (status == 200) {
58 54
                         JSONObject data = json.getJSONObject("data");
59
-                        time = data.getString("time");
60
-                    }
61
-                } catch (Exception e) {
62
-                    LogHelper.d("czy", "时间同步任务 服务器应答异常,采用本地时间 " + time);
63
-                }
64
-                try {
65
-                    HashMap<String, String> boxParams = new HashMap<>();
66
-                    boxParams.put("time", time);
67
-                    if (isCancelled) {
68
-                        return false;
69
-                    }
70
-                    if(BuildConfig.isTestMode){
71
-                        return true;
72
-                    }
73
-                    String setTimeResp = HttpUtils.doHttpPost(BoxUrlContainer.SET_TIME_URL, boxParams);
74
-                    LogHelper.d("czy", "时间同步任务 box设置时间应答=" + setTimeResp);
75
-                    if (isCancelled) {
76
-                        return false;
77
-                    }
78
-                    SystemClock.sleep(1000);
79
-                    if (isCancelled) {
80
-                        return false;
81
-                    }
82
-                    String boxResp = HttpUtils.doHttpPost(BoxUrlContainer.BOX_TIME_URL, null);
83
-                    LogHelper.d("czy", "时间同步任务 box获取时间应答=" + boxResp);
84
-                    if (isCancelled) {
85
-                        return false;
86
-                    }
87
-                    JSONObject boxJson = new JSONObject(boxResp);
88
-                    int boxStatus = boxJson.getInt("status");
89
-                    if (boxStatus == 200) {
90
-                        String boxTime = boxJson.getJSONObject("data").getString("time");
91
-                        if (time.substring(0, 13).equals(boxTime.substring(0, 13))) {
92
-                            return true;
93
-                        }
55
+                        String server_time = data.getString("time");
56
+                        Date serverDate = dateFormat.parse(server_time);
57
+                        return Math.abs(serverDate.getTime()-new Date().getTime())<3600*1000;
94 58
                     }
95 59
                 } catch (Exception e) {
96
-                    LogHelper.e("czy", "时间同步任务发生异常=" + e);
60
+                    LogHelper.d("czy", "时间同步任务 服务器应答异常 " + e);
97 61
                 }
98 62
                 return false;
99 63
             }
@@ -101,7 +65,7 @@ public class SyncTimeInteractor implements BaseInteractor {
101 65
             @Override
102 66
             protected void onPostFail() {
103 67
                 super.onPostFail();
104
-                listener.onTimeSync(false, msgId);
68
+                listener.onTimeSync(false, 0);
105 69
                 LogHelper.d("czy", "时间同步失败");
106 70
             }
107 71
 

+ 1 - 5
app/src/main/java/ai/pai/lensman/session/SessionActivity.java

@@ -226,11 +226,7 @@ public class SessionActivity extends BaseActivity implements SessionContract.Vie
226 226
 
227 227
     @Override
228 228
     public void onClick(View view) {
229
-        if(view.getId()==R.id.btn_print_qr){
230
-            Intent intent = new Intent(this,SessionQRCodeActivity.class);
231
-            intent.putExtra("qrcode",sessionBean.sessionId);
232
-            startActivity(intent);
233
-        }else if(view.getId()==R.id.btn_exit_session_confirm){
229
+       if(view.getId()==R.id.btn_exit_session_confirm){
234 230
             presenter.stop();
235 231
             finish();
236 232
         }

+ 0 - 84
app/src/main/java/ai/pai/lensman/session/SessionQRPopup.java

@@ -1,84 +0,0 @@
1
-package ai.pai.lensman.session;
2
-
3
-import android.app.Activity;
4
-import android.content.Context;
5
-import android.view.LayoutInflater;
6
-import android.view.View;
7
-import android.view.animation.Animation;
8
-import android.widget.Button;
9
-import android.widget.ImageView;
10
-import android.widget.LinearLayout;
11
-import android.widget.TextView;
12
-
13
-import com.android.common.utils.DeviceUtils;
14
-import com.android.views.popup.BasePopupWindow;
15
-
16
-import ai.pai.lensman.R;
17
-import ai.pai.lensman.qrcode.QRCreateUtils;
18
-import ai.pai.lensman.utils.UrlContainer;
19
-import butterknife.ButterKnife;
20
-
21
-public class SessionQRPopup extends BasePopupWindow {
22
-
23
-    private View popupView;
24
-    private Button printQRBtn;
25
-    private ImageView groupQRImg;
26
-    private TextView printerSetText;
27
-    private String groupId;
28
-    private Context context;
29
-    private View.OnClickListener listener;
30
-
31
-    public SessionQRPopup(Activity context, String groupId,View.OnClickListener listener) {
32
-        super(context);
33
-        this.groupId = groupId;
34
-        this.context = context;
35
-        this.listener = listener;
36
-        init();
37
-    }
38
-
39
-    @Override
40
-    protected Animation getShowAnimation() {
41
-        return getDefaultScaleAnimation();
42
-    }
43
-
44
-    @Override
45
-    protected View getClickToDismissView() {
46
-        return popupView.findViewById(R.id.click_to_dismiss);
47
-    }
48
-
49
-    @Override
50
-    public View getPopupView() {
51
-        popupView = LayoutInflater.from(mContext).inflate(R.layout.pop_session_qr, null);
52
-        groupQRImg = ButterKnife.findById(popupView,R.id.iv_group_qrcode);
53
-        printQRBtn = ButterKnife.findById(popupView,R.id.btn_print_qr);
54
-        printerSetText = ButterKnife.findById(popupView,R.id.tv_printer_set);
55
-
56
-        return popupView;
57
-    }
58
-
59
-    private void init(){
60
-        printQRBtn.setOnClickListener(listener);
61
-        printerSetText.setOnClickListener(listener);
62
-
63
-        try{
64
-            initQRImageSize();
65
-            groupQRImg.setImageBitmap(QRCreateUtils.Create2DCode(UrlContainer.HOST_URL+groupId, DeviceUtils.dip2px(context,200)));
66
-            groupQRImg.setVisibility(View.VISIBLE);
67
-        }catch (Exception e){
68
-            e.printStackTrace();
69
-        }
70
-
71
-    }
72
-
73
-    @Override
74
-    public View getAnimaView() {
75
-        return popupView.findViewById(R.id.popup_anima);
76
-    }
77
-
78
-    private void initQRImageSize() {
79
-        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) groupQRImg.getLayoutParams();
80
-        params.width = DeviceUtils.dip2px(context,200);
81
-        params.height = DeviceUtils.dip2px(context,200);
82
-        groupQRImg.setLayoutParams(params);
83
-    }
84
-}

+ 0 - 4
app/src/main/java/ai/pai/lensman/utils/BoxUrlContainer.java

@@ -25,8 +25,4 @@ public class BoxUrlContainer {
25 25
 
26 26
     public static String BOX_INFO_URL = BASE_URL+"box_info";
27 27
 
28
-    public static String SET_TIME_URL = BASE_URL+"set_time";
29
-
30
-    public static String BOX_TIME_URL = BASE_URL+"box_time";
31
-
32 28
 }

+ 0 - 92
app/src/main/res/layout/activity_box_upgrade.xml

@@ -1,92 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:layout_width="match_parent"
4
-    android:layout_height="match_parent"
5
-    xmlns:app="http://schemas.android.com/apk/res-auto"
6
-    android:background="@color/half_transparent">
7
-
8
-<RelativeLayout
9
-    android:id="@+id/layout_choose_update"
10
-    android:layout_width="match_parent"
11
-    android:layout_height="wrap_content"
12
-    android:layout_centerInParent="true">
13
-
14
-    <TextView
15
-        android:layout_width="wrap_content"
16
-        android:layout_height="wrap_content"
17
-        android:text="@string/box_upgrade_found"
18
-        android:layout_centerHorizontal="true"
19
-        android:textSize="18sp"
20
-        android:textColor="@color/white"
21
-        android:id="@+id/tv_box_upgrade_info"/>
22
-
23
-    <Button
24
-        android:id="@+id/btn_update_now"
25
-        android:layout_width="match_parent"
26
-        android:layout_height="40dp"
27
-        android:layout_margin="12dp"
28
-        android:text="@string/upgrade_now"
29
-        android:gravity="center"
30
-        android:textSize="18sp"
31
-        android:textColor="@color/white"
32
-        android:background="@drawable/print_rounded_rect_bg"
33
-        android:layout_below="@+id/tv_box_upgrade_info"
34
-        />
35
-
36
-    <Button
37
-        android:id="@+id/btn_update_later"
38
-        android:layout_width="match_parent"
39
-        android:layout_height="40dp"
40
-        android:text="@string/upgrade_later"
41
-        android:layout_marginLeft="12dp"
42
-        android:layout_marginRight="12dp"
43
-        android:gravity="center"
44
-        android:textSize="18sp"
45
-        android:textColor="@color/white"
46
-        android:background="@drawable/update_btn_rounded_rect_bg"
47
-        android:layout_below="@+id/btn_update_now"
48
-        />
49
-</RelativeLayout>
50
-
51
-    <RelativeLayout
52
-        android:id="@+id/layout_box_updating"
53
-        android:layout_width="match_parent"
54
-        android:layout_height="wrap_content"
55
-        android:layout_centerInParent="true"
56
-        android:visibility="gone">
57
-
58
-        <com.android.views.loadingdrawable.LoadingView
59
-            android:id="@+id/loading_gear_view"
60
-            android:layout_width="180dp"
61
-            android:layout_height="180dp"
62
-            android:layout_centerHorizontal="true"
63
-            app:loading_renderer="GearLoadingRenderer"/>
64
-
65
-        <TextView
66
-            android:id="@+id/tv_updating_status"
67
-            android:layout_width="wrap_content"
68
-            android:layout_height="wrap_content"
69
-            android:textSize="16sp"
70
-            android:text="@string/box_is_upgrading"
71
-            android:layout_below="@id/loading_gear_view"
72
-            android:layout_marginTop="10dp"
73
-            android:layout_centerHorizontal="true"
74
-            android:textColor="@color/white"/>
75
-
76
-        <Button
77
-            android:id="@+id/btn_return_work"
78
-            android:layout_width="match_parent"
79
-            android:layout_height="40dp"
80
-            android:layout_margin="12dp"
81
-            android:text="@string/back_to_work"
82
-            android:gravity="center"
83
-            android:textSize="18sp"
84
-            android:textColor="@color/white"
85
-            android:background="@drawable/print_rounded_rect_bg"
86
-            android:layout_below="@+id/tv_updating_status"
87
-            android:visibility="gone"
88
-            />
89
-
90
-    </RelativeLayout>
91
-
92
-</RelativeLayout>

+ 0 - 119
app/src/main/res/layout/activity_briefs.xml

@@ -362,125 +362,6 @@
362 362
 
363 363
             </LinearLayout>
364 364
 
365
-            <LinearLayout
366
-                android:id="@+id/layout_box_part"
367
-                android:layout_width="match_parent"
368
-                android:layout_height="wrap_content"
369
-                android:layout_marginTop="8dp"
370
-                android:background="@color/background_white"
371
-                android:orientation="vertical">
372
-
373
-                <LinearLayout
374
-                    android:layout_width="match_parent"
375
-                    android:layout_height="32dp"
376
-                    android:orientation="horizontal">
377
-
378
-                    <TextView
379
-                        android:layout_width="wrap_content"
380
-                        android:layout_height="wrap_content"
381
-                        android:layout_gravity="center_vertical"
382
-                        android:paddingLeft="10dp"
383
-                        android:text="@string/box_setting"
384
-                        android:textColor="@color/_7B8088"
385
-                        android:textSize="14sp" />
386
-                </LinearLayout>
387
-
388
-                <View
389
-                    android:layout_width="match_parent"
390
-                    android:layout_height="1px"
391
-                    android:background="@color/text_hint_grey_color" />
392
-
393
-                <LinearLayout
394
-                    android:layout_width="match_parent"
395
-                    android:layout_height="44dp"
396
-                    android:orientation="horizontal">
397
-
398
-                    <TextView
399
-                        android:layout_width="wrap_content"
400
-                        android:layout_height="wrap_content"
401
-                        android:layout_gravity="center_vertical"
402
-                        android:paddingLeft="10dp"
403
-                        android:text="@string/box_no"
404
-                        android:textColor="@color/dark_grey"
405
-                        android:textSize="16sp" />
406
-
407
-                    <TextView
408
-                        android:id="@+id/tv_box_num"
409
-                        android:layout_width="0dp"
410
-                        android:layout_height="match_parent"
411
-                        android:layout_weight="1"
412
-                        android:gravity="center_vertical|right"
413
-                        android:paddingRight="10dp"
414
-                        android:text="SN89757"
415
-                        android:textColor="@color/grey"
416
-                        android:textSize="14sp" />
417
-                </LinearLayout>
418
-
419
-                <View
420
-                    android:layout_width="match_parent"
421
-                    android:layout_height="1px"
422
-                    android:background="@color/text_hint_grey_color" />
423
-
424
-                <LinearLayout
425
-                    android:layout_width="match_parent"
426
-                    android:layout_height="44dp"
427
-                    android:orientation="horizontal">
428
-
429
-                    <TextView
430
-                        android:layout_width="wrap_content"
431
-                        android:layout_height="wrap_content"
432
-                        android:layout_gravity="center_vertical"
433
-                        android:paddingLeft="10dp"
434
-                        android:text="@string/box_status"
435
-                        android:textColor="@color/dark_grey"
436
-                        android:textSize="16sp" />
437
-
438
-                    <TextView
439
-                        android:id="@+id/tv_box_status"
440
-                        android:layout_width="0dp"
441
-                        android:layout_height="match_parent"
442
-                        android:layout_weight="1"
443
-                        android:gravity="center_vertical|right"
444
-                        android:paddingRight="10dp"
445
-                        android:text="@string/connected_device"
446
-                        android:textColor="@color/grey"
447
-                        android:textSize="14sp" />
448
-                </LinearLayout>
449
-
450
-                <View
451
-                    android:layout_width="match_parent"
452
-                    android:layout_height="1px"
453
-                    android:visibility="gone"
454
-                    android:background="@color/text_hint_grey_color" />
455
-
456
-                <LinearLayout
457
-                    android:layout_width="match_parent"
458
-                    android:layout_height="44dp"
459
-                    android:orientation="horizontal"
460
-                    android:visibility="gone"
461
-                    >
462
-
463
-                    <TextView
464
-                        android:layout_width="wrap_content"
465
-                        android:layout_height="wrap_content"
466
-                        android:layout_gravity="center_vertical"
467
-                        android:paddingLeft="10dp"
468
-                        android:text="@string/firmware_version"
469
-                        android:textColor="@color/dark_grey"
470
-                        android:textSize="16sp" />
471
-
472
-                    <TextView
473
-                        android:id="@+id/tv_box_version"
474
-                        android:layout_width="0dp"
475
-                        android:layout_height="match_parent"
476
-                        android:layout_weight="1"
477
-                        android:gravity="center_vertical|right"
478
-                        android:paddingRight="10dp"
479
-                        android:textColor="@color/grey"
480
-                        android:textSize="14sp" />
481
-                </LinearLayout>
482
-
483
-            </LinearLayout>
484 365
 
485 366
             <LinearLayout
486 367
                 android:id="@+id/layout_price_part"

+ 0 - 186
app/src/main/res/layout/activity_printer_setting.xml

@@ -1,186 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:layout_width="match_parent"
4
-    android:layout_height="match_parent"
5
-    android:background="@color/background_light_grey_color">
6
-
7
-    <LinearLayout
8
-        android:id="@+id/title_bar_with_back_btn"
9
-        android:layout_width="match_parent"
10
-        android:layout_height="@dimen/action_bar_height"
11
-        android:background="@color/colorPrimary"
12
-        android:orientation="horizontal">
13
-
14
-        <LinearLayout
15
-            android:id="@+id/title_bar_back_layout"
16
-            android:layout_width="70dp"
17
-            android:layout_height="match_parent"
18
-            android:gravity="center_vertical"
19
-            android:orientation="horizontal"
20
-            android:paddingLeft="12dp">
21
-
22
-            <ImageView
23
-                android:layout_width="32dp"
24
-                android:layout_height="32dp"
25
-                android:src="@drawable/back_selector" />
26
-
27
-        </LinearLayout>
28
-
29
-        <TextView
30
-            android:id="@+id/title_bar_middle_txt"
31
-            android:layout_width="0dp"
32
-            android:layout_height="match_parent"
33
-            android:layout_weight="1"
34
-            android:gravity="center"
35
-            android:paddingLeft="10dp"
36
-            android:paddingRight="10dp"
37
-            android:text="@string/print_qr"
38
-            android:textColor="@color/text_white"
39
-            android:textSize="@dimen/action_bar_title_medium_text_size" />
40
-
41
-        <LinearLayout
42
-            android:id="@+id/title_bar_option_layout"
43
-            android:layout_width="70dp"
44
-            android:layout_height="match_parent"
45
-            android:gravity="center_vertical|right"
46
-            android:orientation="horizontal"
47
-            android:paddingRight="9dp"
48
-            android:visibility="invisible">
49
-
50
-
51
-            <ImageView
52
-                android:id="@+id/iv_options"
53
-                android:layout_width="32dp"
54
-                android:layout_height="32dp"
55
-                android:layout_marginLeft="6dp"
56
-                android:src="@drawable/option" />
57
-
58
-        </LinearLayout>
59
-
60
-    </LinearLayout>
61
-
62
-    <LinearLayout
63
-        android:layout_width="match_parent"
64
-        android:layout_height="match_parent"
65
-        android:layout_below="@id/title_bar_with_back_btn"
66
-        android:orientation="vertical">
67
-
68
-        <ImageView
69
-            android:id="@+id/iv_qrcode"
70
-            android:layout_width="240dp"
71
-            android:layout_height="240dp"
72
-            android:layout_gravity="center_horizontal"
73
-            android:layout_margin="8dp"/>
74
-
75
-        <Button
76
-            android:id="@+id/btn_print_qr"
77
-            android:layout_width="wrap_content"
78
-            android:layout_height="wrap_content"
79
-            android:text="@string/print_qr"
80
-            android:layout_gravity="center_horizontal"
81
-            android:textSize="16sp"
82
-            android:textColor="@color/white"
83
-            android:background="@drawable/print_rounded_rect_bg"
84
-            android:layout_marginBottom="5dp"
85
-            android:paddingLeft="35dp"
86
-            android:paddingRight="35dp"
87
-            android:paddingBottom="5dp"
88
-            android:paddingTop="5dp"/>
89
-
90
-        <LinearLayout
91
-            android:layout_width="match_parent"
92
-            android:layout_height="38dp"
93
-            android:gravity="center_vertical"
94
-            android:orientation="horizontal"
95
-            android:paddingLeft="12dp">
96
-
97
-            <TextView
98
-                android:layout_width="wrap_content"
99
-                android:layout_height="wrap_content"
100
-                android:text="@string/printer_status"
101
-                android:textColor="@color/grey"
102
-                android:textSize="14sp" />
103
-        </LinearLayout>
104
-
105
-
106
-        <LinearLayout
107
-            android:layout_width="match_parent"
108
-            android:layout_height="42dp"
109
-            android:background="@color/white"
110
-            android:gravity="center_vertical"
111
-            android:orientation="horizontal"
112
-            android:paddingLeft="12dp">
113
-
114
-            <TextView
115
-                android:id="@+id/tv_printer_status"
116
-                android:layout_width="match_parent"
117
-                android:layout_height="match_parent"
118
-                android:gravity="center_vertical"
119
-                android:text="@string/click_to_query"
120
-                android:textColor="@color/dark_grey"
121
-                android:textSize="16sp" />
122
-        </LinearLayout>
123
-
124
-
125
-        <LinearLayout
126
-            android:layout_width="match_parent"
127
-            android:layout_height="38dp"
128
-            android:gravity="center_vertical"
129
-            android:orientation="horizontal"
130
-            android:paddingLeft="12dp">
131
-
132
-            <TextView
133
-                android:layout_width="wrap_content"
134
-                android:layout_height="wrap_content"
135
-                android:text="@string/bluetooth_status"
136
-                android:textColor="@color/grey"
137
-                android:textSize="14sp" />
138
-        </LinearLayout>
139
-
140
-
141
-        <LinearLayout
142
-            android:layout_width="match_parent"
143
-            android:layout_height="42dp"
144
-            android:background="@color/white"
145
-            android:gravity="center_vertical"
146
-            android:orientation="horizontal"
147
-            android:paddingLeft="12dp">
148
-
149
-            <TextView
150
-                android:id="@+id/tv_bluetooth_status"
151
-                android:layout_width="0dp"
152
-                android:layout_height="wrap_content"
153
-                android:layout_weight="1"
154
-                android:text="@string/bt_is_enabled"
155
-                android:textColor="@color/dark_grey"
156
-                android:textSize="16sp" />
157
-
158
-
159
-            <ToggleButton
160
-                android:id="@+id/tb_bluetooth_switch"
161
-                android:layout_width="56dp"
162
-                android:layout_height="19dp"
163
-                android:layout_marginRight="12dp"
164
-                android:background="@drawable/toggle_button_selector"
165
-                android:checked="true"
166
-                android:gravity="center"
167
-                android:textColor="@color/white"
168
-                android:textOff="@null"
169
-                android:textOn="@null" />
170
-
171
-        </LinearLayout>
172
-
173
-        <ListView
174
-            android:id="@+id/listview_bt_devices"
175
-            android:layout_width="match_parent"
176
-            android:layout_height="match_parent"
177
-            android:background="@color/white"
178
-            android:paddingLeft="12dp"
179
-            android:paddingRight="6dp"
180
-            android:listSelector="@color/transparent"
181
-            android:cacheColorHint="@color/transparent"/>
182
-
183
-    </LinearLayout>
184
-
185
-
186
-</RelativeLayout>

+ 0 - 63
app/src/main/res/layout/pop_session_qr.xml

@@ -1,63 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:layout_width="match_parent"
4
-    android:layout_height="match_parent">
5
-
6
-    <RelativeLayout
7
-        android:id="@+id/click_to_dismiss"
8
-        android:layout_width="match_parent"
9
-        android:layout_height="match_parent"
10
-        android:background="@color/popup_bg">
11
-
12
-        <LinearLayout
13
-            android:id="@+id/popup_anima"
14
-            android:layout_width="300dp"
15
-            android:layout_height="360dp"
16
-            android:layout_centerInParent="true"
17
-            android:gravity="center"
18
-            android:background="@color/pop_bg_color"
19
-            android:orientation="vertical">
20
-
21
-
22
-            <ImageView
23
-                android:layout_marginTop="16dp"
24
-                android:id="@+id/iv_group_qrcode"
25
-                android:layout_width="200dp"
26
-                android:layout_height="200dp"
27
-             />
28
-
29
-            <TextView
30
-                android:layout_marginTop="16dp"
31
-                android:layout_width="wrap_content"
32
-                android:layout_height="wrap_content"
33
-                android:text="@string/scan_qr_join_group"
34
-                android:textColor="@color/grey"
35
-                android:textSize="12sp" />
36
-
37
-            <Button
38
-                android:id="@+id/btn_print_qr"
39
-                android:layout_width="wrap_content"
40
-                android:layout_height="wrap_content"
41
-                android:paddingLeft="8dp"
42
-                android:paddingRight="8dp"
43
-                android:paddingBottom="5dp"
44
-                android:paddingTop="5dp"
45
-                android:textSize="14sp"
46
-                android:textColor="@color/dark_grey"
47
-                android:layout_marginTop="10dp"
48
-                android:text="@string/print_qr"/>
49
-
50
-            <TextView
51
-                android:id="@+id/tv_printer_set"
52
-                android:layout_marginTop="16dp"
53
-                android:padding="5dp"
54
-                android:layout_width="wrap_content"
55
-                android:layout_height="wrap_content"
56
-                android:text="@string/check_printer"
57
-                android:textColor="@color/light_blue"
58
-                android:textSize="12sp" />
59
-
60
-        </LinearLayout>
61
-
62
-    </RelativeLayout>
63
-</RelativeLayout>

+ 2 - 71
app/src/main/res/values/strings.xml

@@ -64,58 +64,6 @@
64 64
 
65 65
     <string name="no_order_msg">暂无新购买消息</string>
66 66
 
67
-    <string name="print_qr">打印二维码</string>
68
-
69
-    <string name="check_bluetooth">请检查手机蓝牙是否开启</string>
70
-
71
-    <string name="check_printer">打印遇到问题了?去设置</string>
72
-
73
-    <string name="printer_settings">打印机设置</string>
74
-
75
-    <string name="printer_status">打印机状态</string>
76
-
77
-    <string name="query_processing">正在查询打印机状态</string>
78
-
79
-    <string name="bluetooth_status">蓝牙状态</string>
80
-
81
-    <string name="bt_is_enabled">蓝牙已打开</string>
82
-
83
-    <string name="bt_is_disabled">蓝牙已关闭</string>
84
-
85
-    <string name="connected_device">已连接设备</string>
86
-
87
-    <string name="discover_device">搜索设备</string>
88
-
89
-    <string name="paired_devices">已配对设备</string>
90
-
91
-    <string name="bt_discover_complete">蓝牙设备搜索完成</string>
92
-
93
-    <string name="new_usable_devices">新可用设备</string>
94
-
95
-    <string name="printer_is_ok">打印机工作正常</string>
96
-
97
-    <string name="printer_offline">已脱机,请检查</string>
98
-
99
-    <string name="printer_is_connected">已连接打印机</string>
100
-
101
-    <string name="printer_is_disconnected">已断开打印机</string>
102
-
103
-    <string name="click_to_connect">点击连接</string>
104
-
105
-    <string name="connecting">尝试连接中</string>
106
-
107
-    <string name="click_to_query">点击查询打印机状态</string>
108
-
109
-    <string name="go_check_printer">请检查打印机</string>
110
-
111
-    <string name="printer_port_open_fail">打印机端口打开失败</string>
112
-
113
-    <string name="printer_status_query_fail">打印机状态查询失败</string>
114
-
115
-    <string name="printer_service_boot_fail">打印机服务连接失败,请退出应用重试</string>
116
-
117
-    <string name="not_set_printer_yet">尚未设置打印机,去设置</string>
118
-
119 67
     <string name="box_setting">盒子设置</string>
120 68
 
121 69
     <string name="box_no">盒子编号</string>
@@ -176,25 +124,6 @@
176 124
 
177 125
     <string name="upload_settings">上传管理</string>
178 126
 
179
-    <string name="sync_time_server_error">时间同步出错,请检查网络连接</string>
180
-    <string name="sync_time_box_error">时间同步出错,请检查盒子是否打开</string>
181
-
182
-    <string name="time_syncing">正在同步时间...</string>
183
-
184
-    <string name="time_sync_retry">重新同步</string>
185
-
186
-    <string name="box_upgrade_found">发现可用的box软件更新</string>
187
-
188
-    <string name="upgrade_now">立即更新</string>
189
-
190
-    <string name="upgrade_later">下次再说</string>
191
-
192
-    <string name="box_is_upgrading">box软件更新中,约需要一分钟,请勿关闭电源...</string>
193
-
194
-    <string name="box_updating_fail">box软件更新失败,请检查box与手机是否处在同一网络</string>
195
-
196
-    <string name="box_update_success">box软件更新成功,欢迎使用</string>
197
-
198 127
     <string name="back_to_work">返回</string>
199 128
 
200 129
     <string name="exit_session_confirm">退出提示</string>
@@ -203,4 +132,6 @@
203 132
 
204 133
     <string name="cancel">取消</string>
205 134
 
135
+    <string name="check_box_time">请检查手机时间设置是否正确</string>
136
+
206 137
 </resources>